/* -----------------
* brief
* 1. this is code gen by tools
* 2. array like [a,b,c] after each field, define the ui html tag in view,
		a for title,
		b for show or not ,
		c for element html tag , currently support : check、radio、select、input、textarea、upload
* 3. XXX
*/
//使用方法：在工程root目录下，执行go generate ./modules/appmanager/models
//go:generate legogen -type=AppProduct -kv=ModuleName=appmanager,PrjName=saas_sys_base -dirconf=../../.. ./AppProduct.go
package appmanager

import "github.com/mjiulee/lego"

func init() {
	lego.AddBeanToSynList(new(AppProduct))
}

/* table: "tb_app_product"
 * -----------------
 */
type AppProduct struct {
	Id    int64  `xorm:"pk"`               // ["id","hide","hidden"]
	IfDel int    `xorm:"default 0"`        // ["deleted","hide","hidden"]
	Cdate string `xorm:"DateTime created"` // ["create","hide","datetime"]
	Udate string `xorm:"DateTime updated"` // ["update","hide","datetime"]
	// add your custom field here

	//MiniAppIdForSale int64 `xorm:""` // ["销售的微应用ID","hide","hide"] //销售的APP

	AppSuitId int64 `xorm:""` // ["销售的应用套餐ID","hide","hide"] //销售的APP套餐
	AppSuitCode int64 `xorm:""` // ["销售的应用套餐ID","hide","hide"] //销售的APP套餐

	MiniAppId int64 `xorm:""` // ["微应用ID","hide","hide"] //表示在哪个APP上销售，卖方是哪个APP

	//TenantId int64 `xorm:"BigInt  "` // ["关联租户","hide","hide"] //目前这个租户id字段值一般都是0，表示在平台租户下销售


	ProductName string `xorm:"varchar(255)  "` // ["商品名称","show","input"]

	DefaultImage string `xorm:"varchar(255)  "` // ["商品图片","show","input"]

	Video string `xorm:"varchar(255)  "` // ["视频","show","upload"]

	Postage int64 `xorm:""` // ["运费","show","input"]

	Description string `xorm:"text  "` // ["商品详情","show","input"]

	IfSale int `xorm:"default 0"` // ["销售状态","show","input"]

	//EShopId int64 `xorm:"BigInt  "` // ["所属店铺","show","input"]


	Specs []*AppProductSpec `xorm:"-"`  //规格明细列表

	ItemNo string `xorm:"varchar(255)  "` // ["货号","show","input"]
}

type AppProductField struct {
	IfSale string
}

var _AppProductField = AppProductField{
    IfSale: "if_sale",
}


type AppProductInfo struct {
	AppProduct `xorm:"extends"`
	AppProductSpec []AppProductSpec `xorm:"extends"`
}